<%--
  Created by IntelliJ IDEA.
  User: 吕兵星
  Date: 2020/10/24
  Time: 23:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>HOME</title>
    <script src="${pageContext.request.contextPath}/static/jquery-3.5.1.js"></script>
    <script>
        function onclick() {
            let uname=${sessionScope.get("uname")};
            if (uname == null||""==uname){
                document.getElementById("inf").innerText="登录";
                $("#logoutUrl").href="${pageContext.request.contextPath}/toLogin";
            }
        }

    </script>
</head>
<body style="width: 80% ;position: absolute;top: 30px">
<label style="float: right">
    <label><a href="${pageContext.request.contextPath}/toUserInfo">${sessionScope.get("uname")}</a> </label>&nbsp;
    <label onclick="onclick()" ><a id="logoutUrl" href="${pageContext.request.contextPath}/toLogout/${sessionScope.get("uname")}" onclick="onclick()"><label id="inf" onclick="onclick()">退出</label></a></label>
</label>
</body>
</html>
